import request from '@/utils/request'

// 新增租户
export function addTenant(data) {
    return request({
        url: '/sys/tenant/create',
        method: 'post',
        data: data
    })
}

// 新增租户
export function findPageList(data) {
    return request({
        url: '/sys/tenant/findPageList',
        method: 'post',
        data: data
    })
}

// 修改租户
export function updateTenant(data) {
    return request({
        url: '/sys/tenant/update',
        method: 'put',
        data: data
    })
}

// 删除租户
export function deleteTenant(id) {
    return request({
        url: '/sys/tenant/delete/' + id,
        method: 'delete',
    })
}

// 获取租户信息
export function getTenantInfoById(tenantId){
    return request({
        url: `/sys/tenant/getTenantInfoById/${tenantId}`,
        method: 'get'
    })
}

// 切换租户
export function switchTenant(data) {
    return request({
        url: '/sys/tenant/switchTenant',
        method: 'post',
        data: data
    })
}